home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / n_b_v203.zip / DARTBORD.DMO < prev    next >
Text File  |  1996-07-04  |  5KB  |  89 lines

  1. $if 0
  2.     ┌──────────────────────────╖                        PowerBASIC v3.20
  3.  ┌──┤          DASoft          ╟──────────────────────┬──────────────────╖
  4.  │  ├──────────────────────────╢    Copyright 1995    │ DATE: 1995-10-01 ╟─╖
  5.  │  │ FILE NAME   DARTBORD.DMO ║          by          ╘════════════════─ ║ ║
  6.  │  │                          ║  Don Schullian, Jr.                     ║ ║
  7.  │  ╘══════════════════════════╝                                         ║ ║
  8.  │ A license is hereby granted to the holder to use this source code in  ║ ║
  9.  │ any program, commercial or otherwise,  without receiving the express  ║ ║
  10.  │ permission of the copyright holder and without paying any royalties,  ║ ║
  11.  │ as long as this code is not distributed in any compilable format.     ║ ║
  12.  │  IE: source code files, PowerBASIC Unit files, and printed listings   ║ ║
  13.  ╘═╤═════════════════════════════════════════════════════════════════════╝ ║
  14.    │                ....................................                   ║
  15.    ╘═══════════════════════════════════════════════════════════════════════╝
  16.  
  17.    Winmau isn't going to start using this type dartboard soon but it shows
  18.    how the polygon routines can be used for other things than drawing
  19.    polygons. They can compute points on any circle but how you use that
  20.    data is totally up to you! Clocks and their hands can be done also.
  21.  
  22. $endif
  23. '.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
  24. ' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
  25.                                                '┌────────────────────────────
  26. $INCLUDE "DAS-NB03.INC"                        '│ math lib
  27. $INCLUDE "DAS-NBV1.INC"                        '│ graphics lib
  28. $INCLUDE "PUBLICS .INC"                        '│ public variables pPi#
  29.                                                '│
  30. SCREEN 12                                      '│
  31. GraphicSETUP                                   '│
  32. CLS                                            '│
  33.                                                '│
  34. DIM tIn  AS PolygonTYPE, Ipts%(1,20)           '│ inner circle wire points
  35. DIM tOut AS PolygonTYPE, Opts%(1,20)           '│ outter circel wire points
  36. DIM tDbl AS PolygonTYPE, Dpts%(1,20)           '│ double ring paint positions
  37. DIM tTpl AS PolyGonTYPE, Tpts%(1,20)           '│ triple ring paint positions
  38. DIM tS1  AS PolyGonTYPE, S1%(1,20)             '│ inside single ring
  39. DIM tS2  AS PolyGonTYPE, S2%(1,20)             '│ outside single ring
  40.                                                '│
  41. tIn.X        = 320                             '│ double bull
  42. tIn.Y        = 240                             '│
  43. tIn.Radius   =  15                             '│
  44. tIn.Aspect   =   1                             '│
  45. tIn.StartDeg =   9                             '│
  46. tIn.Points   =  20                             '│
  47. tIn.Pmode    =   3                             '│
  48. tIn.Colour   =  10                             '│
  49.                                                '│
  50. LSET tOut = tIn  : tOut.Radius = 175           '│ outside wire
  51. LSET tDbl = tIn  : tDbl.Radius = 100           '│ double beds
  52.                    tDbl.StartDeg = 0           '│   rotate to 0 degrees
  53. LSET tTpl = tDbl : tTpl.Radius = 165           '│ triple beds
  54. LSET tS1  = tTpl : tS1.Radius =   25           '│ single beds (inside)
  55. LSET tS2  = tTpl : tS2.Radius =  110           '│ single beds (outside)
  56.                                                '│
  57. PolygonPoints tIn , Ipts%()                    '│ compute everything
  58. PolygonPoints tOut, Opts%()                    '│  the arrays hold the X,Y
  59. PolygonPoints tDbl, Dpts%()                    '│  positions of the points
  60. PolygonPoints tTpl, Tpts%()                    '│  on the circles where the
  61. PolygonPoints tS1 , S1%()                      '│  wires are drawn or where
  62. PolygonPoints tS2 , S2%()                      '│  to start painting
  63.                                                '│
  64. FOR X% = 1 TO 7                                '│ draw circle wires
  65.   READ Radius?                                 '│
  66.   CIRCLE ( 320, 240 ), Radius?, 7              '│
  67. NEXT                                           '│
  68. DATA 205, 170, 160, 105, 95, 15, 7             '│
  69. PAINT (0,0), 1, 7                              '│ paint the chalk-board
  70.                                                '│
  71. FOR X% = 1 TO 20                               '│ draw bed wires
  72.   GLineDRAW Ipts%(0,X%), Ipts%(1,X%), _        '│
  73.             Opts%(0,X%), Opts%(1,X%), 0, 3, 7  '│
  74. NEXT                                           '│
  75.                                                '│
  76. R? = 4   : G? = 2                              '│ paint beds
  77. FOR X% = 1 TO 20                               '│
  78.   PAINT ( Tpts%(0,X%), Tpts%(1,X%) ), R?, 7    '│ triples
  79.   PAINT ( Dpts%(0,X%), Dpts%(1,X%) ), R?, 7    '│ doubles
  80.   IF ( X% MOD 2 ) = 0 THEN                     '│ single beds
  81.     PAINT ( S1%(0,X%), S1%(1,X%) ), 7, 7       '│
  82.     PAINT ( S2%(0,X%), S2%(1,X%) ), 7, 7       '│
  83.   END IF                                       '│
  84.   SWAP R?, G?                                  '│ switch red/green
  85. NEXT                                           '│
  86. PAINT ( 320, 240 ), R?, 7                      '│ double bull
  87. PAINT ( 320, 250 ), G?, 7                      '│ single bull
  88.                                                '└───────────────────────────
  89.